package com.trimps.steps.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.trimps.steps.mapper.WalkerGroupMapper;
import com.trimps.steps.pojo.WalkerGroup;
import com.trimps.steps.service.IUserWalkerGroupService;
import com.trimps.steps.service.IWalkerGroupService;

@Service("walkerGroupService")
public class WalkerGroupServiceImpl implements IWalkerGroupService {
	@Autowired
	private WalkerGroupMapper walkerGroupMapper;	
    @Autowired
    private IUserWalkerGroupService userWalkerGroupService;    
	
	@Override
	public List<WalkerGroup> getWalkerGroups(int currentPage, int rowPerPage) {
		return walkerGroupMapper.getWalkerGroups(currentPage, rowPerPage);
	}

    @Override
    public int getWalkerGroupCount() {
        return walkerGroupMapper.getWalkerGroupCount();
    }

    @Override
    public List<WalkerGroup> getAllWalkerGroups() {
        return getWalkerGroups(0, Integer.MAX_VALUE);
    }

    @Override
    public int save(WalkerGroup walkerGroup) {
        return walkerGroupMapper.save(walkerGroup);
    }

    @Override
    public List<WalkerGroup> getWalkerGroupByUserId(int userId) {
        return walkerGroupMapper.getWalkerGroupByUserId(userId);
    }

    @Override
    public int delById(int groupId) {
        return walkerGroupMapper.delById(groupId);
    }

}
